package PTA3.ti44;

import java.util.Scanner;


class Person {
    private String name;
    private int age;

    public void setName(String name) {
        this.name = name;
    }
    public String getName() {
        return name;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public int getAge() {
        return age;
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Person(){
        this("none", 1);
    }

    @Override
    public String toString() {
        return "Person [name=" + name + ", age=" + age + "]";
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Person[] persons = new Person[n];
        for (int i = 0; i < n; i++){
            String name = sc.next();
            int age = sc.nextInt();
            persons[i] = new Person(name, age);
        }
        for (Person person : persons){
            System.out.println(person);
        }
        String input = sc.next();
        boolean flag = false;
        for (Person person : persons){
            if (person.getName().equals(input)){
                System.out.println("查询结果：");
                System.out.println(person);
                flag = true;
            }
        }
        if (!flag){
            System.out.println("not found");
        }
        sc.close();
    }
}
